<#
 #   It is recommended to test the script on a local machine for its purpose and effects. 
 #   ManageEngine Endpoint Central will not be responsible for any 
 #   damage/loss to the data/setup based on the behavior of the script.

 #   Description: Script is designed to get the EFI system partition size
 #   Configuration Type - COMPUTER
#>

# Get all disks and their partitions
$disks = Get-Disk

foreach ($disk in $disks) {
    Write-Output "Disk $($disk.Number) - $($disk.Model)"
    $partitions = Get-Partition -DiskNumber $disk.Number
    foreach ($partition in $partitions) {
        $volume = Get-Volume -Partition $partition
        $sizeGB = [math]::round($partition.Size / 1GB, 2)
        $type = if ($partition.GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}') { "EFI System Partition" } else { "Other" }
        
        Write-Output "  Partition $($partition.PartitionNumber): $sizeGB GB ($type)"
    }
}